/*
 * Daniel R Padilla
 *
 * Copyright (c) 2007, Daniel R Padilla
 *
 * This copyrighted material is made available to anyone wishing to use, modify,
 * copy, or redistribute it subject to the terms and conditions of the GNU
 * Lesser General Public License, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this distribution; if not, write to:
 * Free Software Foundation, Inc.
 * 51 Franklin Street, Fifth Floor
 * Boston, MA  02110-1301  USA
 */
package org.databasefacade.testing;

import static org.junit.Assert.*;

import java.io.File;
import java.sql.Connection;

import org.databasefacade.DatabaseFacade;
import org.databasefacade.DatabaseFacadeConst;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 * @author Daniel
 *
 */
public class DatabaseFacadeJUnitTest implements DatabaseFacadeConst {
	String filePath;
	File file;
	
	/**
	 * @throws java.lang.Exception
	 */
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		filePath = "c:\\dbfacade\\config\\Connection.xml";
		file = new File(filePath);
	}

	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
	}

	/**
	 * Test method for {@link org.databasefacade.DatabaseFacade#init(int)}.
	 */
	@Test
	public void testInitConnection() {
		try {
			DatabaseFacade dbFacade = new DatabaseFacade(file, LITE_INITIALIZATION);
			Connection conn = dbFacade.getConnection();
			conn.close();
		} catch (Exception e) {
			e.printStackTrace();
			fail("Establishing a connection caused a failure");
		}
	}
	
	@Test
	public void testFullInitialization() {
		try {
			DatabaseFacade dbFacade = new DatabaseFacade(file);
			Connection conn = dbFacade.getConnection();
			conn.close();
		} catch (Exception e) {
			e.printStackTrace();
			fail("Establishing a connection caused a failure");
		}
	}
	
	@Test
	public void testDatabaseCreate() {
		try {
			DatabaseFacade dbFacade = new DatabaseFacade(file);
			Connection conn = dbFacade.getConnection();
			conn.close();
		} catch (Exception e) {
			e.printStackTrace();
			fail("Establishing a connection caused a failure");
		}
		
	}

	/**
	 * Test method for {@link org.databasefacade.DatabaseFacade#registryTableSynchronize()}.
	 */
	@Test
	public void testRegistryTableSynchronize() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link org.databasefacade.DatabaseFacade#update(org.databasefacade.table.row.Row, java.sql.Connection, org.databasefacade.SessionTracker)}.
	 */
	@Test
	public void testUpdate() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link org.databasefacade.DatabaseFacade#insert(org.databasefacade.table.row.Row, java.sql.Connection, org.databasefacade.SessionTracker)}.
	 */
	@Test
	public void testInsert() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link org.databasefacade.DatabaseFacade#delete(org.databasefacade.table.row.Row, java.sql.Connection, org.databasefacade.SessionTracker)}.
	 */
	@Test
	public void testDelete() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link org.databasefacade.DatabaseFacade#setStringDelimiter(java.lang.String)}.
	 */
	@Test
	public void testSetStringDelimiter() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link org.databasefacade.DatabaseFacade#getStringDelimiter()}.
	 */
	@Test
	public void testGetStringDelimiter() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link org.databasefacade.DatabaseFacade#getDatbaseType()}.
	 */
	@Test
	public void testGetDatbaseType() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link org.databasefacade.DatabaseFacade#getDatabaseTranslator()}.
	 */
	@Test
	public void testGetDatabaseTranslator() {
		fail("Not yet implemented");
	}

}
